package com.endurance.context;

import com.endurance.service.OrderService;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @Author: sunlin
 * @Date: 2024-05-20 9:43
 * @Version: 1.0
 * @Description:
 */
@Component
public class StateContext {

    private OrderService orderService;

    // 相当于是
    public StateContext(@Qualifier("alreadySignedOrderState") OrderService orderService) {
        this.orderService = orderService;
    }

    public void switchState() {
        orderService.status();
    }

}
